﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PermitPage.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Base.PermitPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
    <script type="text/javascript" src="../Scripts/common.js"></script>
    <script type="text/javascript" src="../Scripts/Util.js"></script>
    <script language="javascript" type="text/javascript">
        function Search() {
            var btn = document.getElementById("btnBind");
            btn.click();
        }

        function AddPermit(teacherid, ftype, check) {
            PageMethods.AddPermit(teacherid, ftype, check);
        }

        function TopClick() {
            document.getElementById("txt_Go").value = 1;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = 1;
        }

        function UpClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) > 1) {
                txt.value = parseInt(txt.value) - 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function NextClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = parseInt(txt.value) + 1;
                document.getElementById("btnBind").click();
                document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
            }
        }

        function EndClick() {
            document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
            document.getElementById("btnBind").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }

        function GoClick() {
            var txt = document.getElementById("txt_Go");
            if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
                txt.value = document.getElementById("lbl_PageCount").innerHTML;
            }
            document.getElementById("btnBind").click();
            var patrn = /^[1-9]\d*$/;
            if (patrn.exec(txt.value)) {
                document.getElementById("lbl_ToPage").innerHTML = txt.value;
            } 
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="mainWarp">
            <div class="pageBody">

                <table style="width: 100%;">
                <tr>
                    <td colspan="6" style="height:10px">
                    </td>
                </tr>
                <tr>
                
                    <td style="text-align:left;width:180px">
                        分类：
                        <asp:DropDownList ID="ddl_FType" runat="server"></asp:DropDownList>
                    </td>
                    <td style="text-align:left;width:180px">
                        工号：<asp:TextBox ID="txt_TeacherCode" runat="server" Width=100px></asp:TextBox>
                    </td>
                    <td style="text-align:left;width:180px">
                        姓名：<asp:TextBox ID="txt_TeacherName" runat="server" Width=100px></asp:TextBox>
                    </td>
                    <td style="text-align:left">
                        <input id="btn_Search" type="button" onclick="Search()" class="commonBut" 
                            value="搜索" />
                    </td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="6" style="height:10px">
                    </td>
                </tr>
                <tr>
                    <td colspan="6" align="left">
                
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                                   <asp:Repeater ID="rpt_TeacherType" runat="server" >
                                    <HeaderTemplate>
                                    <table id="settingTable" style="width:90%" class="useList1" border="0" cellpadding="0" cellspacing="1">
                                        <tr  class="tableTitle">
                                            <th>
                                                职务分类
                                            </th>
                                            <th>
                                                工号
                                            </th>
                                            <th>
                                                姓名
                                            </th>
                                            <th>
                                                基础数据管理
                                            </th>
                                            <th>
                                                流程管理
                                            </th>
                                            <th>
                                                拨款管理
                                            </th>
                                            <th>
                                                工作量管理
                                            </th>
                                            <th>
                                                考勤管理
                                            </th>
                                            <th>
                                                核算管理
                                            </th>
                                            <th>
                                                超级管理员
                                            </th>
                                        </tr>
                                    </HeaderTemplate>
                                <ItemTemplate>
                                <tr >
                                    <td style="text-align:left">
                                        <%# DataBinder.Eval(Container.DataItem, "TypeName")%>
                                    </td>
                                    <td style="text-align:left">
                                        <%# DataBinder.Eval(Container.DataItem, "TeachCode")%>
                                    </td>
                                    <td style="text-align:left">
                                        <%# DataBinder.Eval(Container.DataItem, "TeachName")%>
                                    </td>
                                    <td>
                                        <input id="Checkbox1" <%# GetState(DataBinder.Eval(Container.DataItem, "FType1")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,1,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox2" <%# GetState(DataBinder.Eval(Container.DataItem, "FType2")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,2,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox3" <%# GetState(DataBinder.Eval(Container.DataItem, "FType3")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,3,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox4" <%# GetState(DataBinder.Eval(Container.DataItem, "FType4")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,4,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox5" <%# GetState(DataBinder.Eval(Container.DataItem, "FType5")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,5,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox6" <%# GetState(DataBinder.Eval(Container.DataItem, "FType6")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,6,this.checked)' type="checkbox" />
                                    </td>
                                    <td>
                                        <input id="Checkbox7" <%# GetState(DataBinder.Eval(Container.DataItem, "Super")) %> onclick='AddPermit(<%# DataBinder.Eval(Container.DataItem, "TeacherID")%>,7,this.checked)' type="checkbox" />
                                    </td>
                                </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                                </asp:Repeater>
                        <div class="page" style="width:60%;margin-top:10px">
                        <span ><input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                        <span ><input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                        <span ><input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                        <span ><input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                        <span class="disabled"><asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label> <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label> / <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label> <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span>
                        <span ><asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                            <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px"></asp:TextBox>
                                            <asp:regularexpressionvalidator id="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
					                            ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:regularexpressionvalidator>
                                            </span><asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span>
                        <span ><input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                        </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnBind"  EventName="Click" />
                        </Triggers>

                    </asp:UpdatePanel>

                    </td>
                </tr>
                <tr>
                    <td ></td>
                    <td></td>
                    <td  align="center" style="height:50px">
                        </td>
                     <td></td>
                    <td ></td>
                    <td></td>
                </tr>
                </table>
                <div style="display: none;">
                    <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind" />
                </div>
            </div>
        </div>
    </form>
</body>
</html>
